<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- <script src="./index.js"></script> -->
    
    <style>
        .flex {
            display: flex;
            width: 500px;
            height: 500px;
            background-color: antiquewhite;
        }

        .flex1 {
            background-color: red;
            flex: 1;
        }

        .flex2 {
            background-color: aqua;
            flex: 1;
            min-width: 0;
        }

        span {
            font-size: 2em;
        }

        #container {
            width: 340px;
            background-color: #aaa;
            display: grid;
            grid-template-columns: 100px 100px 100px;
            grid-template-rows: 100px 100px 100px;
            justify-content: space-between;
            align-content: space-between;

        }

        .item {
            font-size: 4em;
            text-align: center;
            border: 1px solid #e5e4e9;
        }

        .item-1 {
            background-color: #ef342a;
        }

        .item-2 {
            background-color: #f68f26;
        }

        .item-3 {
            background-color: #4ba946;
        }

        .item-4 {
            background-color: #0376c2;
        }

        .item-5 {
            background-color: #c077af;
        }

        .item-6 {
            background-color: #f8d29d;
        }

        .item-7 {
            background-color: #0376c2;
        }

        .item-8 {
            background-color: #c077af;
        }

        .item-9 {
            background-color: #f8d29d;
        }

        /* .box1 {
            width: 300px;
            background-color: #c077af;
        } */

        .box2 {
            display: flex;
            background-color: #aaa;
        }

        .box3 {}

        .noWrap {
            background-color: #f68f26;
            white-space: nowrap;
        }
    </style>
</head>

<body>
    <div  id="div1">sdfg</div>
    <div class="box1">
        <div class="box2">
            <div class="box3">
                <p class="noWrap"> 以上3个父元素 有一个加了flex 这个元素下面的元素就会被noWrap撑起 ,喽哈喽哈喽哈喽哈喽哈喽哈哈喽哈喽</p>
            </div>
        </div>
    </div>

    <div class="flex">
        <div class="flex1">我在有文字的情况可以被挤为1个文字的宽度</div>
        <div>哈喽哈喽哈喽哈喽哈喽哈喽哈哈喽哈喽哈喽哈喽哈喽哈喽哈喽哈喽哈哈喽哈喽</div>
        <div class="flex2">
            <p>我在有文字的情况可以被挤为0px</p>
        </div>
    </div>
    <div class="container">
        <span>foo</span>
        <div id="container">
            <div class="item item-1">1</div>
            <div class="item item-2">2</div>
            <div class="item item-3">3</div>
            <div class="item item-4">4</div>
            <div class="item item-5">5</div>
            <div class="item item-6">6</div>
            <div class="item item-7">7</div>
            <div class="item item-8">8</div>
            <div class="item item-9">9</div>
        </div>
        <span>bar</span>
    </div>
</body>
<script src="./indexAfter.js"></script>
</html>